﻿using B.WMS.InWareHouseManagement;
using B.WMS.StandardReturn;
using B.WMS.WMSDtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace B.WMS.WMSUpdateLog
{
    public class WMSUpdateLogAppService : ApplicationService, IWMSUpdateLogAppService
    {
        private readonly IRepository<B.WMS.WMSEntities.WMSUpdateLogs.WMSUpdateLog, Guid> _wmsUpdateLogRepository;

        public WMSUpdateLogAppService(IRepository<WMSEntities.WMSUpdateLogs.WMSUpdateLog, Guid> wmsUpdateLogRepository)
        {
            _wmsUpdateLogRepository = wmsUpdateLogRepository;
        }

        public async Task<ApiResult<List<WMSUpdateLogDto>>> GetWMSUpdateLogList()
        {
            var wmsUpdateLogs = await _wmsUpdateLogRepository.GetListAsync(); 
            var dtos = ObjectMapper.Map<List<WMSEntities.WMSUpdateLogs.WMSUpdateLog>, List<WMSUpdateLogDto>>(wmsUpdateLogs);
            return new ApiResult<List<WMSUpdateLogDto>>()
            {
                Code = ApiCode.Success,
                ResultData = dtos,
                Message = "成功"
            };

        }
    }
}
